package com.bw.shop.room

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy.REPLACE
import androidx.room.Query
import androidx.room.Update
import com.bw.shop.entity.CartEntity


@Dao
interface CartDao {

    @Insert(onConflict = REPLACE)
    fun insert(cartEntity: CartEntity)

    @Delete
    fun delete(cartEntity: CartEntity)

    @Query("select*from Cart where id=:id")
    fun query(id:Int): CartEntity

    @Query("select*from Cart")
    fun queryAll(): MutableList<CartEntity>

    @Update
    fun update(cartEntity: CartEntity)

}